package com.wanghengzhi.design.patterns.creational.abstractfactory;

/**
 * @author wanghengzhi
 * @since 2020.11.6
 */
public class ColorFactory extends AbstractFactory{

    private static final String RED = "RED";
    private static final String GREEN = "GREEN";
    private static final String BLUE = "BLUE";

    @Override
    public Color getColor(String color) {
        if(color == null){
            return null;
        }
        if(RED.equalsIgnoreCase(color)){
            return new Red();
        } else if(GREEN.equalsIgnoreCase(color)){
            return new Green();
        } else if(BLUE.equalsIgnoreCase(color)){
            return new Blue();
        }
        return null;
    }

    @Override
    public Shape getShape(String shape) {
        return null;
    }
}
